<?php
	include "../ini.php";
    include_once '../../includes/function.php';
	include "../../libraries/xl_hoa_don.php"; 
	$dt_xl_hoa_don = new xl_hoa_don;
	include "../../libraries/xl_chi_tiet_hoa_don.php"; 
	$dt_xl_chi_tiet_hoa_don = new xl_chi_tiet_hoa_don;
	if (empty($_GET['ma']))
	{
		$_SESSION['type_msg'] = 'error';
		$_SESSION['msg'] = 'Lỗi! Dữ liệu không hợp lệ! Vui lòng kiểm tra lại!';	
		header('Location: ../trang_chu/index.php');
		exit;
	}
	$code=$_GET['ma'];
	$hoa_don=$dt_xl_hoa_don->xem_hoa_don($code);
	if($hoa_don==NULL)
	{
		$_SESSION['type_msg'] = 'error';
		$_SESSION['msg'] = 'Lỗi! Mã hóa đơn không tồn tại! Vui lòng kiểm tra lại!';	
		header('Location: ../trang_chu/index.php');
		exit;
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include'../widgets/js_css.php'?>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include '../widgets/sidebar.php'?>
  <div id="main-content"> <!-- Main Content Section with everything -->
  <!--noscript-->
    <!-- Page Head --> 
    <!-- End .shortcut-buttons-set -->
    
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Danh sách sản phẩm</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
          <?php thong_bao()?>
          <form action="cap_nhat_tt_sm.php" method="post"><input type="hidden" name="ma_hd" value="<?php echo $hoa_don['ma_hd']?>"/>
          <table>
            <tr>
              <th style="width:100px">Mã hóa đơn</th>
              <td><span style="color:red;font-weight:bold"><?php echo $hoa_don['ma_hd']?></span></td>
            </tr>
            <tr>
              <th>Họ tên</th>
              <td><?php echo $hoa_don['ho_ten']?></td>
            </tr>
            <tr>
              <th>Trạng thái</th>
              <td><select name="trang_thai">
                  <option style="text-align:left" <?php if($hoa_don['trang_thai']==0) echo 'selected="selected"'?> value="0" name="trang_thai" id="trang_thai">Đơn hàng đã chấp nhận</option>
                  <option style="text-align:left" <?php if($hoa_don['trang_thai']==1) echo 'selected="selected"'?> value="1" name="trang_thai" id="trang_thai">Đã thanh toán và đang giao hàng</option>
                  <option style="text-align:left" <?php if($hoa_don['trang_thai']==2) echo 'selected="selected"'?> value="2" name="trang_thai" id="trang_thai">Đang giao hàng và nhận tiền thanh toán</option>
                  <option style="text-align:left" <?php if($hoa_don['trang_thai']==3) echo 'selected="selected"'?> value="3" name="trang_thai" id="trang_thai">Đã giao hàng</option>
                </select></td>
            </tr>
            <tr>
              <td colspan="2"><div class="bulk-actions align-left">
                  <input type="submit" value="Cập Nhật" name="cap_nhat" class="button">
                  <input type="button" onclick="window.location.href='danh_sach.php'" value="Bỏ Qua" name="bo_qua" class="button">
                </div>
                <div class="clear"></div></td>
            </tr>
          </table>
          </form>
        </div>
        <!-- End #tab1 --> 
        
      </div>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <div class="clear"></div>
    <div id="footer"> <small> <!-- Remove this notice or replace it with whatever you want --> 
    <!-- End #footer --> 
    
  </div>
  <!-- End #main-content --> 
</div>
</body>
</html>